﻿using M_Quality.API.Application.Command.QualitygroupCommand;
using M_Quality.API.Application.Command.QualityinspectionCommand;
using M_Quality.Repository.Impl;
using M_Quality.Repository.Interface;
using MediatR;

namespace M_Quality.API.Application.CommandHandler.QualityinspectionHandler
{
    public class QualityinspectionUpdateCommandHandler : IRequestHandler<QualityinspectionUpdateCommand, int>
    {

        protected readonly IQualityinspectionRepository qualityinspectionRepository;

        public QualityinspectionUpdateCommandHandler(IQualityinspectionRepository qualityinspectionRepository)
        {
            this.qualityinspectionRepository = qualityinspectionRepository;
        }

        public async Task<int> Handle(QualityinspectionUpdateCommand request, CancellationToken cancellationToken)
        {
            return await qualityinspectionRepository.UpdateAsync(request);
        }
    }
}
